﻿

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;

namespace .BizLogic
{
    using RDIFramework.BizLogic;
    using RDIFramework.Utilities;

    /// <summary>
    /// pmwebsitecolumnEntity
    /// pm-站点栏目
    /// 
    /// 修改纪录
    /// 
    /// 2025-01-18 版本：3.5  创建主键。
    /// 
    /// 版本：3.5
    /// 
    /// <author>
    /// <name></name>
    /// <date>2025-01-18</date>
    /// </author>
    /// </summary>
    [Serializable]
    public partial class pmwebsitecolumnEntity : BaseEntity
    {
        /// <summary>
        /// 栏目id
        /// </summary>
        [Key] 
        [ScaffoldColumn(false)] 
        [DataMember] 
        public int? Id { get; set; } 

        /// <summary>
        /// 栏目名称
        /// </summary>
        [StringLength(200, ErrorMessage = "栏目名称不能超过200个字符")] 
        [Display(Name = "栏目名称")] 
        [Required(ErrorMessage = "需要输入栏目名称")]
        [DataMember] 
        public string ColumnName { get; set; } 

        /// <summary>
        /// 栏目上级id
        /// </summary>
        [Display(Name = "栏目上级id")] 
        [Required(ErrorMessage = "需要输入栏目上级id")]
        [DataMember] 
        public int? ParentId { get; set; } 

        /// <summary>
        /// Ancestors
        /// </summary>
        [StringLength(50, ErrorMessage = "Ancestors不能超过50个字符")] 
        [Display(Name = "Ancestors")] 
        [Required(ErrorMessage = "需要输入Ancestors")]
        [DataMember] 
        public string Ancestors { get; set; } 

        /// <summary>
        /// 所属站点id
        /// </summary>
        [Display(Name = "所属站点id")] 
        [Required(ErrorMessage = "需要输入所属站点id")]
        [DataMember] 
        public int? WebsiteId { get; set; } 

        /// <summary>
        /// 面包屑导航
        /// </summary>
        [StringLength(200, ErrorMessage = "面包屑导航不能超过200个字符")] 
        [Display(Name = "面包屑导航")] 
        [Required(ErrorMessage = "需要输入面包屑导航")]
        [DataMember] 
        public string Breadcrumb { get; set; } 

        /// <summary>
        /// 显示位置：0=不显示,1=菜单，2=首页，3=菜单+首页
        /// </summary>
        [Display(Name = "显示位置：0=不显示,1=菜单，2=首页，3=菜单+首页")] 
        [Required(ErrorMessage = "需要输入显示位置：0=不显示,1=菜单，2=首页，3=菜单+首页")]
        [DataMember] 
        public int? DisplayPosition { get; set; } 

        /// <summary>
        /// 创建时间
        /// </summary>
        [StringLength(, ErrorMessage = "创建时间不能超过个字符")] 
        [Display(Name = "创建时间")] 
        [Required(ErrorMessage = "需要输入创建时间")]
        [DataMember] 
        public string CreateTime { get; set; } 

        /// <summary>
        /// 修改时间
        /// </summary>
        [StringLength(, ErrorMessage = "修改时间不能超过个字符")] 
        [Display(Name = "修改时间")] 
        [Required(ErrorMessage = "需要输入修改时间")]
        [DataMember] 
        public string UpdateTime { get; set; } 

        /// <summary>
        /// 创建人
        /// </summary>
        [StringLength(64, ErrorMessage = "创建人不能超过64个字符")] 
        [Display(Name = "创建人")] 
        [Required(ErrorMessage = "需要输入创建人")]
        [DataMember] 
        public string CreateBy { get; set; } 

        /// <summary>
        /// 修改人
        /// </summary>
        [StringLength(64, ErrorMessage = "修改人不能超过64个字符")] 
        [Display(Name = "修改人")] 
        [Required(ErrorMessage = "需要输入修改人")]
        [DataMember] 
        public string UpdateBy { get; set; } 

        /// <summary>
        /// 排序
        /// </summary>
        [Display(Name = "排序")] 
        [Required(ErrorMessage = "需要输入排序")]
        [DataMember] 
        public int? Sortnum { get; set; } 

        /// <summary>
        /// 拼音码
        /// </summary>
        [StringLength(100, ErrorMessage = "拼音码不能超过100个字符")] 
        [Display(Name = "拼音码")] 
        [Required(ErrorMessage = "需要输入拼音码")]
        [DataMember] 
        public string Pinyin { get; set; } 

        /// <summary>
        /// 运行状态,0=停用,1=正常
        /// </summary>
        [Display(Name = "运行状态,0=停用,1=正常")] 
        [Required(ErrorMessage = "需要输入运行状态,0=停用,1=正常")]
        [DataMember] 
        public byte? Status { get; set; } 

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(, ErrorMessage = "备注不能超过个字符")] 
        [Display(Name = "备注")] 
        [Required(ErrorMessage = "需要输入备注")]
        [DataType(DataType.MultilineText)]
        [DataMember] 
        public String Remark { get; set; } 

        /// <summary>
        /// 构造函数
        /// </summary>
        public pmwebsitecolumnEntity()
        {
        }


        /// <summary>
        /// 从数据行读取
        /// </summary>
        /// <param name="dataRow">数据行</param>
        protected override BaseEntity GetFrom(IDataRow dataRow)
        {
            this.Id = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsitecolumnTable.FieldId]);
            this.ColumnName = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldColumnName]);
            this.ParentId = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsitecolumnTable.FieldParentId]);
            this.Ancestors = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldAncestors]);
            this.WebsiteId = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsitecolumnTable.FieldWebsiteId]);
            this.Breadcrumb = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldBreadcrumb]);
            this.DisplayPosition = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsitecolumnTable.FieldDisplayPosition]);
            this.CreateTime = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldCreateTime]);
            this.UpdateTime = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldUpdateTime]);
            this.CreateBy = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldCreateBy]);
            this.UpdateBy = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldUpdateBy]);
            this.Sortnum = BusinessLogic.ConvertToNullableInt(dataRow[pmwebsitecolumnTable.FieldSortnum]);
            this.Pinyin = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldPinyin]);
            this.Status = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldStatus]);
            this.Remark = BusinessLogic.ConvertToString(dataRow[pmwebsitecolumnTable.FieldRemark]);
            return this;
        }
    }
}
